import Parsing 

p :: Parser String
p = do {
    symbol ">";
    xs <- p;
    return $ "抓翀翀！ " ++ xs
} <|> do {
    symbol "<";
    xs <- p;
    return $ "抓猫猫！ " ++ xs
} <|> do {
    symbol "+";
    xs <- p;
    return $ "啊呜！ " ++ xs
} <|> do {
    symbol "-";
    xs <- p;
    return $ "木啊^3^♥ " ++ xs
} <|> do {
    symbol ".";
    xs <- p;
    return $ "耶！ " ++ xs
} <|> do {
    symbol ",";
    xs <- p;
    return $ "学习qwq " ++ xs
} <|> do {
    symbol "[";
    xs <- p;
    return $ "抱抱嘛 " ++ xs
} <|> do {
    symbol "]";
    xs <- p;
    return $ "要抱抱 " ++ xs
} <|> do {
    sat (\_->True);
    xs <- p;
    return xs
} <|> do {
    return "困困啦。。。 "
}

main = do {
    bfCode <- readFile "sample.bf";
    let {
        ranCode = case parse p bfCode of
            [] -> ""
            [(result, _)] -> result
    };
    writeFile "sample.ran" ranCode
}
